home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 2003 August / MW 8 2003 CD1.iso / Inside Macworld / Product News / gimp-1.2.4.sit / gimp-1.2.4 / plug-ins / perl / examples / feedback < prev    next >
Encoding:
Text File  |  2000-05-21  |  1.2 KB  |  42 lines

  1. #!/usr/bin/perl
  2.  
  3. # Revision 1.0: Released it
  4. #          1.1: Marc Lehman added undo capability! <pcg@goof.com>
  5. #          1.2: Added my email, and put it in "Noise" where it belongs 
  6. #                <sjburges@gimp.org>
  7.  
  8.  
  9. use Gimp;
  10. use Gimp::Fu;
  11.  
  12. register "feedback",
  13.          "Take an image and feed it back onto itself multiple times",
  14.          "This plug-in simulates video feedback.  It makes for kinda a neat desktop if you're into that sort of thing",
  15.          "Seth Burgess",
  16.          "Seth Burgess <sjburges\@gimp.org>",
  17.          "2-15-99",
  18.          N_"<Image>/Filters/Noise/Feedback...",
  19.          "RGB, GRAY",
  20.          [
  21.           [PF_SLIDER,    "offset",    "the amount the frames will offset", 3, [0, 255, 1]],
  22.           [PF_SLIDER,    "repeat",    "the number of times to repeat the illusion", 3, [0, 100, 1]],
  23.          ],
  24.          sub {
  25.    my($img,$drawable,$offset,$repeat)=@_;
  26.    
  27.    eval { $img->undo_push_group_start };
  28.    
  29.    for (; $repeat>0; $repeat--) { 
  30.         $drawable = $img->flatten;
  31.         $copylayer = $drawable->copy(1);
  32.      $img->add_layer($copylayer,0);
  33.      $copylayer->scale($img->width - $offset, $img->height - $offset, 0);    
  34.     }
  35.     $img->flatten;
  36.    eval { $img->undo_push_group_end };
  37.     return();
  38. };
  39.  
  40. exit main;
  41.  
  42.